//
//  Kylin_TableViewCell.m
//  03-BuDeJie-2 TabBar设置
//
//  Created by Kylin on 16/2/8.
//  Copyright © 2016年 kylin. All rights reserved.
//

#import "Kylin_TableViewCell.h"
#import <UIImageView+WebCache.h>
#import "Kylin_tagsModel.h"
@interface Kylin_TableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *imageListView;
@property (weak, nonatomic) IBOutlet UILabel *themeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *subNameLabel;


@end

@implementation Kylin_TableViewCell


// 重写这个方法拦截 cell的frame 设置
- (void)setFrame:(CGRect)frame{
    frame.size.height -= 1;
    [super setFrame:frame];
    
}

- (void)setTagModel:(Kylin_tagsModel *)tagModel{
    
    _tagModel = tagModel;
    
    
//    // 使用SDWEB下截
//    [self.imageListView sd_setImageWithURL:[NSURL URLWithString:tagModel.image_list] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
    
    // 设置头像
    
    [self.imageListView setIconWithURL:tagModel.image_list];
    
    // 主题名称
    self.themeNameLabel.text = tagModel.theme_name;
    
    
    //订阅数
    if (tagModel.sub_number >= 10000) {
        
        self.subNameLabel.text = [NSString stringWithFormat:@"%.1f万人订阅",tagModel.sub_number /10000.0];
    }else{
        self.subNameLabel.text = [NSString stringWithFormat:@"%.1zd万人订阅",tagModel.sub_number];
    }
    
}


@end
